

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%
        request.setAttribute("nombrePagina", "Plantilla");
%>
<f:view>

    <%@include file="/WEB-INF/jspf/header.jspf" %>
    <%@include file="/WEB-INF/jspf/breadcumbs.jspf" %>
    
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Listado de Persona Naturales</title>
        </head>
        <body>

    <h:messages id="messages" styleClass="messages_content" layout="table" errorClass="error" warnClass="warn" infoClass="info"/>

    <h:form>

        <h1>Listado de Personas Naturales</h1>

        <h:panelGrid columns="5">
            <h:commandButton id="btnVolver" value="Volver" action="volver"/>
            <h:commandButton id="btnNuevo" value="Nuevo" action="#{PersonaNaturalController.nuevo}" />
            <h:outputLabel value="DNI: " for="txtBuscarDNI" />
            <h:inputText id="txtBuscarDNI" value="#{PersonaNaturalController.criterioDNI}"/>
            <h:commandButton id="btnBuscar" value="Buscar" action="buscar"/>
        </h:panelGrid>
        <h:dataTable id="tblPersonas"
                     value="#{PersonaNaturalController.personasNaturales}"
                     var="item" rowClasses="TableRow1,TableRow2" columnClasses="TableColumn"
                                         bgcolor="#F1F1F1" border="10" cellpadding="5"
                                         cellspacing="3" first="0"
                                         frame="hsides" rules="all"
                                         styleClass="TableClass" headerClass="TableHeader" footerClass="TableFooter" rows="7">
            <h:column>
                <f:facet name="header"><h:outputText value="Nombre Completo"/></f:facet>
                <h:outputText value="#{item.nombrePersona} #{item.apePaternoPersona} #{item.apeMaternoPersona}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="DNI"/></f:facet>
                <h:outputText value="#{item.dniPersona}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Sexo"/></f:facet>
                <h:outputText value="#{item.sexPersona}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Fec. Nac."/></f:facet>
                <h:outputText value="#{item.fecnacPersona}" >
                    <f:convertDateTime pattern="dd/MM/yyyy" />
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Estado Civil"/></f:facet>
                <h:outputText value="#{item.estadoCivil}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Dirección"/></f:facet>
                <h:outputText value="#{item.direccion}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Teléfono"/></f:facet>
                <h:outputText value="#{item.telefono}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="Email"/></f:facet>
                <h:outputText value="#{item.email}" />
            </h:column>
            <h:column>
                <h:commandButton id="btnSeleccionar" value="Seleccionar" action="seleccionar">
                    <f:setPropertyActionListener target="#{GarantiaController.aval.cliente}" value="#{item}" />
                </h:commandButton>
            </h:column>            
        </h:dataTable>
        <t:dataScroller id="scroll_1"
                        for="tblPersonas"
                        fastStep="5"
                        pageCountVar="pageCount"
                        pageIndexVar="pageIndex"
                        styleClass="scroller"
                        paginator="true"
                        paginatorMaxPages="8"
                        paginatorTableClass="paginator"
                        paginatorActiveColumnStyle="font-weight:bold;"
                        immediate="true">
                <f:facet name="first" >
                    <t:graphicImage url="/flechas/arrow-first.gif" border="1"/>

                </f:facet>
                <f:facet name="last">
                    <t:graphicImage url="/flechas/arrow-last.gif" border="1"/>
                </f:facet>
                <f:facet name="previous">
                    <t:graphicImage url="/flechas/arrow-previous.gif" border="1" />
                    <h:outputText value="Ant." style="" />
                </f:facet>
                <f:facet name="next">
                    <t:graphicImage url="/flechas/arrow-next.gif" border="1" />
                    <h:outputText value="Sig." style="" />
                </f:facet>
            </t:dataScroller>
    </h:form>

    </body>
    </html>
    <%@include file="/WEB-INF/jspf/footer.jspf" %>
</f:view>